#define  _CRT_SECURE_NO_WARNINGS  1
#include <stdio.h>
int main()
{
	int N;
	scanf("%d", &N);
	int a[20][20] = { 0 };
	int i, j;
	int sum = 0, count = 0;
	int b[400] = { 0 };
	int k = 0;
	for (i = 0; i < N; i++)
	{
		for (j = 0; j < N; j++)
		{
			scanf("%d", &a[i][j]);
			if (i == j || i + j == N - 1)
			{
				b[k] = a[i][j];
				k++;
			}
		}
	}
	for (i = 0; i < k; i++)
	{
		sum = sum + b[i];
		if (b[i] != 0)
			count++;
	}
	
	printf("sum = %d, count = %d.", sum, count);


	return 0;
}